import 'dart:ui';

import 'package:flutter/material.dart';
import 'package:flutter_country_website/model/View.dart';
import 'package:get/get.dart';
import 'package:get/get_state_manager/get_state_manager.dart';

class ScenicDetailPage extends StatefulWidget {
  ScenicDetailPage({
    Key? key,
    required this.detail
  }) : super(key: key);

  final View detail;

  @override
  State<ScenicDetailPage> createState() => _ScenicDetailPageState();
}

class _ScenicDetailPageState extends State<ScenicDetailPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Stack(
        children: [
          Container(
            width: Get.width,
            height: Get.height,
            child: Hero(
                tag: widget.detail.title!,
                child: Image.network(widget.detail.image!, fit: BoxFit.cover, alignment: Alignment.topCenter,)
            ),
          ),
          BackdropFilter(
            filter: ImageFilter.blur(sigmaX: 3.0, sigmaY: 3.0),
            child: Container(
              width: Get.width,
              height: Get.height,
            ),
          ),
          Positioned(
            right: 30,
            top: 40,
            child: Text('姓名+学号', style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),),
          ),
          Positioned(
              left: 15,
              top: 30,
              child: GestureDetector(
                onTap: () {
                  Navigator.of(context).pop();
                },
                child: Icon(Icons.arrow_back_ios_new_rounded, size: 20, color: Colors.white),
              )
          ),
          Positioned(
            left: 0,
            right: 0,
            // top: 300,
            bottom: 0,
            // bottom: 100,
            child: Container(
              decoration: BoxDecoration(
                borderRadius: BorderRadius.circular(12),
                // color: Colors.white,
              ),
              margin: EdgeInsets.only(top: 10),
              padding: EdgeInsets.symmetric(horizontal: 15, vertical: 10),
              child: SingleChildScrollView(
                child: Row(
                  children: [
                    Expanded(child: Text(widget.detail.desc!, style: TextStyle(fontSize: 15, color: Colors.white, fontWeight: FontWeight.bold)))
                  ],
                ),
              ),
            )
          )
        ],
      ),
    );
  }
}
